﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.S.DataBase.SuYuan.Infrastructrue.Migrations
{
    public partial class awqq : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Commoditys",
                columns: table => new
                {
                    CommId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Zt = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Commoditys", x => x.CommId);
                });

            migrationBuilder.CreateTable(
                name: "Companys",
                columns: table => new
                {
                    C_ComId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    S_CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    S_Companyaddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    establishTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Briefintroduction = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    C_Faems = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    C_ComHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    C_Quantity = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    P_CommpanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    P_License = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Companys", x => x.C_ComId);
                });

            migrationBuilder.CreateTable(
                name: "Cultivations",
                columns: table => new
                {
                    CultId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Rearingdays = table.Column<int>(type: "int", nullable: false),
                    Rearingbrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RearingHead = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Cultivations", x => x.CultId);
                });

            migrationBuilder.CreateTable(
                name: "Goodss",
                columns: table => new
                {
                    G_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommId = table.Column<int>(type: "int", nullable: false),
                    G_batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_Shelf = table.Column<int>(type: "int", nullable: false),
                    G_License = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_enterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_image = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Goodss", x => x.G_Id);
                });

            migrationBuilder.CreateTable(
                name: "Imgs",
                columns: table => new
                {
                    I_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    G_batch = table.Column<long>(type: "bigint", nullable: false),
                    I_moduletype = table.Column<int>(type: "int", nullable: false),
                    I_functiontype = table.Column<int>(type: "int", nullable: false),
                    Image = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Imgs", x => x.I_Id);
                });

            migrationBuilder.CreateTable(
                name: "Immunitys",
                columns: table => new
                {
                    Im_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Im_feedingdays = table.Column<int>(type: "int", nullable: false),
                    Im_manner = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Im_method = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Immunitys", x => x.Im_Id);
                });

            migrationBuilder.CreateTable(
                name: "Slaughters",
                columns: table => new
                {
                    SlauId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SlauBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Averageweight = table.Column<int>(type: "int", nullable: false),
                    PresentTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughters", x => x.SlauId);
                });

            migrationBuilder.CreateTable(
                name: "Vendorcompanys",
                columns: table => new
                {
                    V_CompanyId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Team = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    v_Head = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Vendorcompanys", x => x.V_CompanyId);
                });

            migrationBuilder.CreateTable(
                name: "Vendors",
                columns: table => new
                {
                    VenId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    V_batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    V_type = table.Column<int>(type: "int", nullable: false),
                    v_img = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    G_batch = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Vendors", x => x.VenId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Commoditys");

            migrationBuilder.DropTable(
                name: "Companys");

            migrationBuilder.DropTable(
                name: "Cultivations");

            migrationBuilder.DropTable(
                name: "Goodss");

            migrationBuilder.DropTable(
                name: "Imgs");

            migrationBuilder.DropTable(
                name: "Immunitys");

            migrationBuilder.DropTable(
                name: "Slaughters");

            migrationBuilder.DropTable(
                name: "Vendorcompanys");

            migrationBuilder.DropTable(
                name: "Vendors");
        }
    }
}
